// Copyright (C) 2012 by Johann Duscher <jonny.dee@gmx.net>
// 
// This file is part of barcodeart-pp.
//
// barcodeart-pp is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// barcodeart-pp is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with barcodeart-pp. If not, see <http://www.gnu.org/licenses/>.

#pragma once

#include "barcodeart/AEncoderConfig.hpp"


namespace barcodeart
{

namespace qrcode
{

namespace ErrorCorrection
{

enum Level
{
    LOW,
    MEDIUM,
    QUALITY,
    HIGH
};

}

namespace Encoding
{

enum Type
{
    NUMERIC,        // Max. 7,089 characters (0, 1, 2, 3, 4, 5, 6, 7, 8, 9)
    ALPHANUMERIC,   // Max. 4,296 characters (0–9, A–Z [upper-case only], space, $, %, *, +, -, ., /, :)
    BINARY,         // Max. 2,953 characters (8-bit bytes) (23624 bits)
    KANJI           // Max. 1,817 characters
};

}

class EncoderConfig : public AEncoderConfig
{
public:
    EncoderConfig()
        : m_errorCorrectionLevel(ErrorCorrection::MEDIUM),
          m_encodingType(Encoding::ALPHANUMERIC),
          m_caseSensitive(true),
          m_version(0)
    {
    }

    void setErrorCorrectionLevel(ErrorCorrection::Level value)
    {
        m_errorCorrectionLevel = value;
    }

    ErrorCorrection::Level getErrorCorrectionLevel() const
    {
        return m_errorCorrectionLevel;
    }

    void setEncodingType(Encoding::Type value)
    {
        m_encodingType = value;
    }

    Encoding::Type getEncodingType() const
    {
        return m_encodingType;
    }

    void setCaseSensitive(bool value)
    {
        m_caseSensitive = value;
    }

    bool isCaseSensitive() const
    {
        return m_caseSensitive;
    }

    void setVersion(int value)
    {
        m_version = value;
    }

    int getVersion() const
    {
        return m_version;
    }

    void serialize(std::ostream &out) const
    {
    }

    void deserialize(std::istream &in) const
    {
    }

private:
    ErrorCorrection::Level m_errorCorrectionLevel;
    Encoding::Type m_encodingType;
    bool m_caseSensitive;
    int m_version;
};

}

}
